#if MSC_VER >=1000
    #pragma execution_character_set("UTF-8")
#endif

#include "tsngsong.h"
#include<QTextStream>
#include<QJsonDocument>
#include<QJsonObject>
#include<QJsonParseError>
#include<QDebug>

TSNGSong::TSNGSong()
{

}

TSNGSong TSNGSong::parseFromJSON(QString jstr)
{
    TSNGSong tSng;
    QJsonDocument doc = QJsonDocument::fromJson(jstr.toLocal8Bit().data());

    if(doc.isNull()){
        qDebug()<<"JSONString null";
        return tSng;
    }

    QJsonObject jsonObject = doc.object();
    qDebug()<<jsonObject;


    return tSng;
}

void TSNGSong::setId(long id)
{
    this->id = id;

}

void TSNGSong::setName(QString name)
{
    this ->name = name;
}

void TSNGSong::setArtists(std::vector<Artists> ar)
{
    this->artists = ar;
}

void TSNGSong::setAlbum(Album al)
{
    this ->album = al;
}

void TSNGSong::setDuration(long duration)
{
    this ->duration = duration;
}

void TSNGSong::setCopyrightId(long cpId)
{
    this ->copyrightId = cpId;

}

void TSNGSong::setStatus(int status)
{
    this ->status = status;
}

void TSNGSong::setAlias(QString alias)
{
    this -> alias = alias;
}

void TSNGSong::setRtype(int rt)
{
    this ->rtype = rt;
}

void TSNGSong::setFtype(int ft)
{

    this ->ftype = ft;

}

void TSNGSong::setMvid(long mid)
{
    this ->mvid = mid;
}

void TSNGSong::setFee(int fee)
{
    this ->fee = fee;
}

void TSNGSong::setRUrl(QString url)
{
    this ->rUrl = url;

}

long TSNGSong::getId() const
{
    return this->id;
}

QString TSNGSong::getName() const
{

    return this->name;
}

std::vector<Artists> TSNGSong::getArtists()
{
    return this->artists;
}

Album TSNGSong::getAlbum()
{
    return this ->album;
}

long TSNGSong::getDuration() const
{
    return this ->duration;
}

long TSNGSong::getCopyrightId()const
{
    return this ->copyrightId;
}



 int TSNGSong::getStatus() const
{
    return status;
}

QString TSNGSong::getAlias() const
{
    return this->alias;
}

int TSNGSong::getRtype() const
{
    return this->rtype;
}

int TSNGSong::getFtype() const
{
    return this->ftype;
}

long TSNGSong::getMvid() const
{
    return this->mvid;
}

int TSNGSong::getFee() const
{
    return this->fee;
}

QString TSNGSong::getRUrl() const
{
    return this->rUrl;
}
